﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<ObjectModel.Customer>>" %>

<asp:Content Id="Content2" ContentPlaceHolderId="HeaderContent" runat="server">
</asp:Content>
<asp:Content Id="Content1" ContentPlaceHolderId="MainContent" runat="server">
    <script type="text/javascript">
    	selectMenu('User');
    </script>	
    <table cellpadding="1" cellspacing="1" border="1" class="listTable">
        <tr class="listHeader">
            <th>
                Ações
            </th>
            <th>
                Nome
            </th>
            <th>
                Razão social
            </th>
            <th>
                CNPJ
            </th>
        </tr>

    <% foreach (var item in Model)
	   { %>
       <%if (Model.IndexOf(item) % 2 == 0)
		 { %>
    
        <tr class="listRowLight" >
            <td class="action">
                <%: Html.ActionLink("Edit", "Edit", new { Id = item.Id })%> |
                <%: Html.ActionLink("Details", "Details", new { Id = item.Id })%> |
                <%: Html.ActionLink("Delete", "Delete", new { Id = item.Id })%>
            </td>
            <td>
                <%: item.Name%>
            </td>
            <td>
                <%: item.CorporateName%>
            </td>
            <td>
                <%: item.Document%>
            </td>
            
        </tr>
        <%}
		 else
		 { %>
        <tr class="listRow" >
            <td class="action">
                <%: Html.ActionLink("Edit", "Edit", new { Id = item.Id })%> |
                <%: Html.ActionLink("Details", "Details", new { Id = item.Id })%> |
                <%: Html.ActionLink("Delete", "Delete", new { Id = item.Id })%>
            </td>
            <td>
                <%: item.Name%>
            </td>
            <td>
                <%: item.CorporateName%>
            </td>
            <td>
                <%: item.Document%>
            </td>
        </tr>
    
    <% }
	   }%>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

